/**
 * 
 */
package de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.tests;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.SuffixFeatures;
/**
 * 
 * @author Christoph Teichmann
 * created Jun 9, 2014 3:29:26 PM
 * @version 0.1
 */
public class TestSuffixFeatures
{
	/**
	 * 
	 */
	private SuffixFeatures sf1;
	/**
	 * 
	 */
	private SuffixFeatures sf2;
	/**
	 *
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception
	{
		sf1 = new SuffixFeatures(2);
		sf2 = new SuffixFeatures(3);
	}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.SuffixFeatures#getFeatName(java.lang.String)}.
	 */
	@Test
	public final void testGetFeatName()
	{
		assertEquals(sf1.getFeatName("Hammer"),"er");
		assertEquals(sf1.getFeatName("r"),"r");
		assertEquals(sf1.getFeatName("Alternative"),"ve");
		assertEquals(sf2.getFeatName("Hammer"),"mer");
		assertEquals(sf2.getFeatName("er"),"er");
		assertEquals(sf2.getFeatName("Alternative"),"ive");
	}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.SuffixFeatures#updateWeight(java.lang.String, boolean, double)}.
	 */
	@Test
	public final void testUpdateWeight()
	{
		assertEquals(sf1.updateWeight("er", true, 1.0),1.0,0.00000001);
		assertEquals(sf1.updateWeight("he", false, 1.0),2.0,0.00000001);
		assertEquals(sf2.updateWeight("tea", false, 1.0),2.0,0.00000001);
	}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.SuffixFeatures#getType()}.
	 */
	@Test
	public final void testGetType()
	{assertEquals(sf1.getType(),"multinomial");}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.SuffixFeatures#process(java.lang.String)}.
	 */
	@Test
	public final void testProcess()
	{assertEquals(sf1.process("Hammer"),"Hammer");}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.SuffixFeatures#name()}.
	 */
	@Test
	public final void testName()
	{assertEquals(sf1.name(),"SUFFIXFEATURES");}
}